package org.example.mapper;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.example.pojo.Emp;
import org.example.pojo.EmpQueryParam;

import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper {
    //条件查询
    List<Emp> list(EmpQueryParam empQueryParam);

    //新增员工
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(Emp emp);

    //查询总记录数
    Long count();

    //分页查询
    List<Emp> listByPage(Integer start, Integer pageSize);

    //批量删除员工基本信息
    void deleteByIds(List<Integer> ids);

    void updateById(Emp emp);

    @MapKey("pos")
    List<Map<String,Object>> countEmpJobData();

    @MapKey("name")
    List<Map> countEmpGenderData();

    Emp selectByUsernameAndPassword(Emp emp);
}